// components/todo-item/index.js

Component({
	/**
	 * 组件的属性列表
	 */

	properties: {
		taskid: String,
		subject: String,
		scheduledstart: String,
		tel: String,
		mobile: String,
		url: String,
		new_type: Number
	},

	/**
	 * 组件的初始数据
	 */
	data: {
      statusicon:"visit-normal",
	},

	
lifetimes: {
    // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
    attached: function () {
		if(!this.data.tel && !this.data.mobile)
		{
			this.setData({
				statusicon:"visit-nophone",
			});
		}
	},
    moved: function () { },
    detached: function () { },
  },

	methods: {
	
		enterDetail() {
			wx.navigateTo({
				url: this.data.url
			})
		},
		onCanel: function(e) {
			var event = e;
			/*
			 *这里的handleSearch必须和页面的<searchBar bind:handleSearch="..."></searchBar>的绑定的函数名一致
			 *
			 */
			this.triggerEvent('handCanel', {
			    taskId: this.properties.taskid,
				event
			}, {})
		},
	}
})
